package com.service;

import com.config.DS;
import com.dao.ComponentDao;
import com.entity.Component;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @author XiaoHao
 * @date 2021-03-18 15:45
 */
@Service
public class ComponentService {
    @Autowired
    ComponentDao componentDao;

    /**
     * 插入数据到MySQL数据库中
     * @param component
     */
    @DS("mysql")
    public void insert(Component component){
        componentDao.insert(component);
    }

    /**
     * 从SQLServer数据库中查询数据
     * @param component
     * @return
     */
    public List<Map<Object,Object>> select(Component component){
        return componentDao.select(component);
    }
}
